//
//  ViewController.m
//  Demo
//
//  Created by LG on 2018/8/14.
//  Copyright © 2018年 LG. All rights reserved.
//

#import "ViewController.h"
#import "GestureVC.h"
#import "NSString+YYAdd.h"
#import <CommonCrypto/CommonDigest.h>

//秘钥
static NSString *encryptionKey = @"nha735n197nxn(N′568GGS%d~~9naei';45vhhafdjkv]32rpks;lg,];:vjo(&**&^)";


@interface ViewController ()
@property (weak, nonatomic) IBOutlet UILabel *lbl;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //在branch 添加 1 行
    //在branch 添加 2 行
    //添加第一行文件
    //添加第二行文件
    //添加第三行 在branch上
    //添加第五行 在branch上 5:05 没添加到master上
    
    //添加第6行 在branch上 5:18 没添加到master上
    //添加第7行 在branch上 5:19 没添加到master上
    
    NSDictionary *dic = @{@"key":@"value"};
    NSLog(@"%@",[dic objectForKey:@"key1"]);
    
    NSString *string = @"hello";
    NSString *str1 = [[self class] md5EncryptWithString:string];
    NSString *str2 = [string md5String];
    NSLog(@"");
    
    //2019年1月8号 14:17提交
    //2019年1月8号 14:18提交
}

+ (NSString *)md5EncryptWithString:(NSString *)string{
    return [self md5:[NSString stringWithFormat:@"%@", string]];
}

+ (NSString *)md5:(NSString *)string{
    const char *cStr = [string UTF8String];
    unsigned char digest[CC_MD5_DIGEST_LENGTH];
    
    CC_MD5(cStr, (CC_LONG)strlen(cStr), digest);
    
    NSMutableString *result = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
    for (int i = 0; i < CC_MD5_DIGEST_LENGTH; i++) {
        [result appendFormat:@"%02X", digest[i]];
    }
    
    return result;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // 添加第四行 在master上
}

- (IBAction)push:(UIButton *)sender {
    GestureVC *vc = [[GestureVC alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}

@end
